home *** CD-ROM | disk | FTP | other *** search
- ////////////
- // isam.h //
- ////////////
-
- #ifndef isam_h
- #define isam_h
- extern "C" {
- #include <cbtree.h> // CBTREE header
- #include <btfio.h> // CBTREE header
- }
-
- typedef char *(*t_func)(char *);
- typedef int (*rel_func)(char *);
-
- class Isam
- {
- private:
- int elements, fd[2], btr[10], indices, backingout;
- long * loc;
- char ** oldrec, * okey, * nkey, ** inames;
- BTC * btc; // CBTREE specific
- int getxxx (int index, int opt); // CBTREE specific
- void backout (int ele, char op, int index = -1,
- int result = 0);
- public:
- char ** rec;
-
- Isam (const char *datafilename, int e = 1);
- ~Isam ();
-
- int read (const char *key, int ele_limit = 0,
- int idx = 0, int ele = 0);
- int write ();
- void clear ();
- int getfirst (int index = 0);
- int getnext (int index = 0);
- int getge (char *key, int index = 0);
- int keynum (const char *btname);
- void reindex (rel_func func);
- };
-
- char * nospace(const char *arg);
- int eprintf(const char *format, ...);
- char * ToUpper(const char *c);
-
- ///////////////////////////////
- // catalog utility functions //
- ///////////////////////////////
-
- int catalog_number (char *name);
- t_func cataloged_func (int f );
-
- #endif
-
-